![]() | ![]() | ![]() | ![]() |
When you use an INFILE statement with the FILEVAR option to read concatenated files, an error might occur if a later file has a larger LRECL value than the first file. This problem can also occur if there are multiple data set names in a FILENAME statement.
data _null_; file 'userid.test.lrecl500' lrecl=500 recfm=v; put 'lrecl500: record 1'; run; data _null_; file 'userid.test.lrecl18k' lrecl=18000 recfm=v; put 'lrecl18k: record 1'; /* example with datasets concatenated in the FILENAME statement */ filename concat ('userid.sas.lrecl500' 'userid.sas.lrecl18k'); data _null_; infile concat pad; input; put _infile_; run; /* example with FILEVAR option in INPUT statement */ data test; length dsname $ 44; if _n_=1 or fileend then link getfile; infile test filevar=dsname length=linelen end=fileend; input @1 line $varying80. linelen; list; return; getfile: infile cards; input @1 dsname $char44.; return; cards; userid.test.lrecl500' userid.test.lrecl18K' run;
You can circumvent this problem using the LS= option in the INFILE statement.
Code LS=nnnn in the INFILE statement, where nnnn is the largest LRECL of any data set being read.
The LS= option in the INFILE statement specifies how much of a record can be used by the INPUT statement. If the LRECL for a file is smaller than the LS= option, then the entire record is available for use by the INPUT statement. If the LRECL for a file is larger than the LS= option, then only the number of bytes specified in the LS= option is available to the INPUT statement.
A fix for this issue is planned for a future software release.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | z/OS | 9.3 TS1M1 | 9.4 TS1M0 |